﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace OmniKits.Extensions
{
    using NullGuard;

    public static class EnumerableExtensions
    {
#pragma warning disable 1591

        public static IEnumerable<T> AntiNull<T>([AllowNull]this IEnumerable<T> source)
        {
            return source ?? new T[] { };
        }

        public static IEnumerable<T> ToFakeEnumerable<T>(this IEnumerator<T> enumerator)
        {
            return new FakeEnumerable<T>(enumerator);
        }
    }
}
